#coding=utf-8
from subprocess import Popen, PIPE


def runcmd(cmd):

    # 创建一个新的子进程来运行命令
    process = Popen([cmd], shell=True, stdout=PIPE, stderr=PIPE)

    # 从子进程获取输出和错误信息
    stdout, stderr = process.communicate()

    # 打印输出信息
    return stdout.decode('gbk')
